import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Enumeration;
import java.util.GregorianCalendar;
import java.util.Properties;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Test11 {

	public static void main(String[] args) {
		
		Test11 a = new Test11();
//		a.test2();
		a.prop();
//		System.out.println(TimeZone.getDefault().getDisplayName());
	}

	public void mm() throws Exception {
		Calendar processDate = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
		System.out.println("date= " + processDate.getTime());
		System.out.println(processDate.get(Calendar.YEAR) + "-"
				+ (processDate.get(Calendar.MONTH) + 1) + "-" + processDate.get(Calendar.DATE));
		String d = "2012-10-10";

		processDate.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(d));
		System.out.println("date= " + processDate.getTime());
		System.out.println(processDate.get(Calendar.YEAR) + "-"
				+ (processDate.get(Calendar.MONTH) + 1) + "-" + processDate.get(Calendar.DATE));


		Calendar date = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
		System.out.println("date= " + date.getTime());
		date.set(Calendar.MONTH, 0);
		System.out.println("date= " + date.getTime());
		
		// processDate.set(Calendar.YEAR, Integer.parseInt(d.substring(0, 4)));
		// processDate.set(Calendar.MONTH, Integer.parseInt(d.substring(5,
		// 7))-1);
		// processDate.set(Calendar.DAY_OF_MONTH,
		// Integer.parseInt(args[1].substring(8)));
		// processDate.set(Calendar.HOUR_OF_DAY, 0);
		// processDate.set(Calendar.MINUTE, 0);
		// processDate.set(Calendar.SECOND, 0);

		System.out.println();
		// Here we assume the args[1] is one GMT date, so need not to convert
		// again.
	}

	public void test2(){
		
		long a = 10L;
		long b = 3L;
		
		System.out.println((float)100/30);
		System.out.println(Math.ceil((float)100/30));
		
	}
	public void offset() {
		Calendar myCalendar = new GregorianCalendar();

		int gmtOffset = myCalendar.get(Calendar.ZONE_OFFSET);
		System.out.println("GMT Offset is " + gmtOffset + " milliseonds (or "
				+ TimeUnit.HOURS.convert(gmtOffset, TimeUnit.MILLISECONDS) + " hours)");

		Calendar myCalendar2 = new GregorianCalendar();
		TimeZone timeZone = myCalendar2.getTimeZone();
		int gmtOffset2 = timeZone.getRawOffset();
		System.out.println("GMT Offset is " + gmtOffset2 + " milliseonds (or "
				+ TimeUnit.HOURS.convert(gmtOffset2, TimeUnit.MILLISECONDS) + " hours)");
	}
	
	private void process(){
		Pattern p = Pattern.compile("mms.mnc(\\d{3}).mcc(\\d{3}).gprs");
		Matcher m = p.matcher("mms.mnc123.mcc456.gprs");
		if (m.matches()) {
			m.reset();
			while (m.find()) {
				System.out.println(m.group(1));
				System.out.println(m.group(2));
				
			}
		}
	}
	
	private void prop(){
		final Properties p = System.getProperties();
        final Enumeration e = p.keys();
        while (e.hasMoreElements())
        {
            final String prt = (String) e.nextElement();
            final String prtvalue = System.getProperty(prt);
            System.out.println(prt + ":" + prtvalue);
        }
	}
}